package com.bj.zspace.cloud.order.controller;

import com.bj.zspace.cloud.model.order.Order;
import com.bj.zspace.cloud.order.service.OrderService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping(value = "/api/order")
@RestController
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping(value = "/create")
    private Order createOrder(@RequestParam("productId") Long productId,
                              @RequestParam("userId") Long userID) {
        return orderService.creteateOrder(productId, userID);
    }

}
